import request from '@/utils/request.js'
/**
 *列表
 * @param {*} data
 * @returns
 */
export function list(data) {
    return request({
        url: '/zfRandomTask/list',
        method: 'get',
        data,
        headers: {
            isToken: true
        },
    })
}
//创建任务保存新增
export function add(data) {
    return request({
        url: '/zfRandomTask',
        method: 'post',
        data,
        headers: {
            isToken: true
        },
    })
}
//创建任务新增
export function createTask(data) {
    return request({
        url: '/zfRandomTask/createTask',
        method: 'post',
        data,
        headers: {
            isToken: true
        },
    })
}
//查看任务
export function lookTask(data) {
    return request({
        url: '/zfRandomTaskObject/list',
        method: 'get',
        data,
        headers: {
            isToken: true
        },
    })
}
//查看已完成任务
export function lookDoneTask(id) {
    return request({
        url: '/zfRandomTaskObject/phone/'+id,
        method: 'get',
        headers: {
            isToken: true
        },
    })
}
//查看已完成任务
export function lookResultTask(data) {
    return request({
        url: '/zfRandomTaskRecord/getInfo/',
        data,
        method: 'get',
        headers: {
            isToken: true
        },
    })
}
//详情
export function lookTaskDetails(id) {
    return request({
        url: '/zfRandomTaskObject/'+id,
        method: 'get',
        headers: {
            isToken: true
        },
    })
}
//派发任务
export function distributeTask(ids) {
    return request({
        url: '/zfRandomTaskObject/pf/'+ ids,
        method: 'get',
        headers: {
            isToken: true
        },
    })
}
//跟据id看详情
export function editId(id) {
    return request({
        url: '/zfRandomTask/' + id,
        method: 'get',
        headers: {
            isToken: true
        },
    })
}
//编辑
export function edit(data) {
    return request({
        url: '/zfRandomTask',
        method: 'put',
        data,
        headers: {
            isToken: true
        },
    })
}
/**
 *删除
 * @param {*} data
 * @returns
 */
export function del(ids) {
    return request({
        url: '/zfRandomTask/' + ids,
        method: 'delete',
        headers: {
            isToken: true
        },
    })
}

/**导出 */
export function ExportData(data) {
    return request({
        url: '/zfRandomTaskObject/export',
        method: 'post',
        responseType: 'blob',
        data,
        headers: {
        isToken: true
        },
    })
}
